<%@ include file="IsAdmin.jsp"%><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<%
	String title = "SPMS: Homepage";
        
%>
<title><%=title%></title>
<link href="css/stylesheet.css" rel="stylesheet" type="text/css" />
<%@ include file="../master\head.jsp"%>
</head>
<body>
<div id="container">
<div id="wrapper">
<div id="sidebar">
<div id="sb_top"><%@ include file="../master\sbTop.jsp"%>
</div>

<div class="sb_content"><!--##########--> <!-- Start Menu --> <%@ include
	 file="..\master\adminMenu.jsp"%> <!-- Profile -->
<%@ include file="..\master\profile.jsp"%> <!-- links -->
<%@ include file="..\master\links.jsp"%>
<div class="copyright"><%@ include file="../master\copyright.jsp"%>
</div>

</div>
<!-- /sb_content --></div>
<!-- /sidebar --> <!-- Top -->
<div id="header"><%@ include file="../master\header.jsp"%>
</div>


<!-- Start main content -->
<div id="content">
<div id="intro">
<div class="intro_t">
<h1><span>..</span>Welcome to<span>..</span></h1>
<h2>student project managment system</h2>

</div>
</div>
<!-- /intro -->

<h1>Change administrator password</h1>

<form name="chngpass" action="adminpass.jsp" method="post">
<%@ page import="java.sql.*,database.*"%>
<%

DBCon db = new DBCon();
String oldpassword = db.getAdminPass();


%>

<h2>old password</h2><input type="password" name="oldpass" onfocus="document.getElementById('checkerror').innerHTML = ''"/><br />
<h2>New password</h2><input type="password" name="newpass" onfocus="document.getElementById('checkerror').innerHTML = ''"/><br />
<h2>confirm new password</h2><input type="password" name="renewpass" onfocus="document.getElementById('checkerror').innerHTML = ''"/>
<br /><br />
<input type="button" value="Update" onclick="check()"/><br />
<div id=checkerror></div>
<br />
</form>
<script>
    function check()
    {
        
        var div = document.getElementById("checkerror");
        var oldpassword = "<%=oldpassword%>";
        
        if(document.chngpass.oldpass.value != oldpassword)
             div.innerHTML = "The old password is not correct";
      
        else if(document.chngpass.newpass.value != document.chngpass.renewpass.value)
              div.innerHTML = "The new password and confirm new password are not match";
        else
                document.chngpass.submit();
        
    }
</script>
</div>
<!-- /content --></div>
<!-- /wrapper -->
<div class="clear">&nbsp;</div>
<!-- Important! Fix the problem of height in Firefox --></div>
<!-- /Container -->


</body>
</html>